package com.wslds.base.dao.page;

import java.util.List;

public class PageAdapter<T> {

	private List<T> data; 		//分页数据
	
	private long totalSize;		//最大数量
	
	private long curPage;		//当前页
	
	private long maxPage;		//最大页数
	
	private int perPageCount = 10; 	//每页多少个

	public PageAdapter( List<T> pageData, long totalSize, long curPage, int perPageCount ){
		
		this.data = pageData;
		this.totalSize = totalSize;
		this.curPage = curPage;
		this.perPageCount = perPageCount;
		
		maxPage = totalSize%perPageCount == 0 ? totalSize/perPageCount : (totalSize/perPageCount)+1; 
		
	}
	
	public PageAdapter( List<T> pageData, long totalSize, long curPage){
		this(pageData,totalSize,curPage,10);
	}
	

	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}

	public long getTotalSize() {
		return totalSize;
	}

	public void setTotalSize(long totalSize) {
		this.totalSize = totalSize;
	}

	public int getPerPageCount() {
		return perPageCount;
	}

	public void setPerPageCount(int perPageCount) {
		this.perPageCount = perPageCount;
	}

	public long getCurPage() {
		return curPage;
	}

	public void setCurPage(long curPage) {
		this.curPage = curPage;
	}

	public long getMaxPage() {
		return maxPage;
	}

	public void setMaxPage(long maxPage) {
		this.maxPage = maxPage;
	}
	
}
